﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Ny.CenterServers.Migrations
{
    public partial class _20160803 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<Guid>(
                name: "Id",
                table: "TestModel",
                nullable: false,
                oldClrType: typeof(int))
                .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);

            migrationBuilder.AddColumn<string>(
                name: "CreationName",
                table: "TestModel",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "CreationTime",
                table: "TestModel",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<DateTime>(
                name: "DeletionTime",
                table: "TestModel",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "TestModel",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<string>(
                name: "LastModificationName",
                table: "TestModel",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "LastModificationTime",
                table: "TestModel",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "TenantId",
                table: "TestModel",
                nullable: false,
                defaultValue: 0);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CreationName",
                table: "TestModel");

            migrationBuilder.DropColumn(
                name: "CreationTime",
                table: "TestModel");

            migrationBuilder.DropColumn(
                name: "DeletionTime",
                table: "TestModel");

            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "TestModel");

            migrationBuilder.DropColumn(
                name: "LastModificationName",
                table: "TestModel");

            migrationBuilder.DropColumn(
                name: "LastModificationTime",
                table: "TestModel");

            migrationBuilder.DropColumn(
                name: "TenantId",
                table: "TestModel");

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "TestModel",
                nullable: false,
                oldClrType: typeof(Guid))
                .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
        }
    }
}
